<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
class breadcrumb{
    public function create(sfUser $user, $routes){
        $breadcrumbs = $user->getAttribute('breadcrumb');
        if($breadcrumbs == ''){

            $breadcrumbs = array();
            $breadcrumbs['Home'] = 'homepage';
        }
        foreach($routes as $route){
   
       $breadcrumbs[$route['title']] = $route['link'];
        }
return $breadcrumbs;
    }
public function addFilter(sfUser $user, $route){
$breadcrumbs = $user->getAttribute('breadcrumb');
$breadcrumbs[$route['title']] = 'filter' ;
return $breadcrumbs;

}

public function addProduct(sfUser $user, $product){
    $breadcrumbs = $user->getAttribute('breadcrumb');
    $breadcrumbs[$product] = 'product';
    return $breadcrumbs;
}
}
?>
